import { apiRequest } from '@/utils/request'
import type { ILoginRequest, ILoginResponse } from '@/types/apis/auth'

/**
 * 账号密码登录
 */
export function loginApi(data: ILoginRequest) {
  return apiRequest<ILoginResponse>({
    method: 'post',
    url: '/mock/auth/login',
    data,
  })
}

/**
 * 获取验证码
 */
export function getCaptchaApi() {
  return apiRequest<{ text: string; svg: string }>({
    method: 'get',
    url: '/mock/auth/captcha',
  })
}
